/*
 * @Description:
 * @Author: Ambrose
 * @Date: 2022-01-15 17:23:36
 * @LastEditTime: 2024-06-22 09:55:28
 * @LastEditors: Ambrose
 */
import { createRouter, createWebHashHistory } from 'vue-router'

const routes = [
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/login')
  },
  {
    path: '/',
    name: '/',
    component: () => import('../layout'),
    redirect: '/employee',
    children: [
      {
        path: 'employee',
        name: 'employee',
        component: () => import('@/views/employee/index.vue')
      },
      {
        path: 'producer',
        name: 'producer',
        component: () => import('@/views/producer/index.vue')
      },
      {
        path: 'product',
        name: 'product',
        component: () => import('@/views/product/index.vue')
      },
      {
        path: 'purchase',
        name: 'purchase',
        component: () => import('@/views/purchase/index.vue')
      },
      {
        path: 'detail',
        name: 'detail',
        component: () => import('@/views/detail/index.vue')
      },
      {
        path: 'total',
        name: 'total',
        component: () => import('@/views/total/index.vue')
      }
    ]
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
